package com.chuanke.family.face;

import com.chuanke.ckfamily.service.base.FailCode;
import com.chuanke.ckfamily.service.exception.CFException;

public class Response {

    private boolean success;

    private int failCode;

    private String msg;

    private Object data;

    public Response(Object data) {
        this.success = true;
        this.data = data;
    }

    public Response(FailCode failCode, String msg) {
        this.success = false;
        this.failCode = failCode.getCode();
        this.msg = msg;
    }

    public Response(CFException cfException) {
        this.success = false;
        this.failCode = cfException.getCode();
        this.msg = cfException.getMsg();
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public int getFailCode() {
        return failCode;
    }

    public void setFailCode(int failCode) {
        this.failCode = failCode;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
